package com.xzy.learn.spring.factory;

import com.xzy.learn.spring.entity.Student;
import org.springframework.beans.factory.FactoryBean;

/**
 * @author xzy.xiao
 * @date 2022/6/1  15:08
 */
public class StudentFactoryBean implements FactoryBean<Student> {
    @Override
    public Student getObject() throws Exception {
        System.out.println("StudentFactoryBean::getObject() is invoked");
        return new Student();
    }

    @Override
    public Class<?> getObjectType() {
        return Student.class;
    }

    @Override
    public boolean isSingleton() {
        return false;
    }

    @Override
    public String toString() {
        return "StudentFactoryBean{}";
    }
}
